#include "KeyboardAction.h"
#include "QDivaAppController.h"
#include "DIVA_Application.h"
#include "QLogger.h"
#include "DIVA_RenderData.h"
#include "DIVA_Manager.h"


void MoveBackward::onKeyPressed(){
	QDivaAppController *controller = DIVA_Application::getInstance()->getController();
	if ( controller->isLeftButtonPressed() ){
		DIVA_Manager::getInstance()->lock();
		controller->dragVM( QDivaAppController::DRAG_BACKWARD );
		DIVA_Manager::getInstance()->release();
	} else{
		DIVA_RenderData::getSingletonPtr()->moveBck(true);
	}
}

void MoveBackward::onKeyReleased(){
	DIVA_RenderData::getSingletonPtr()->moveBck(false);
}
